{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\n/* eslint-disable default-case */\nimport classNames from 'classnames';\nimport { useBaseProps } from 'rc-select';\nimport * as React from 'react';\nimport CascaderContext from '../context';\nimport { isLeaf, scrollIntoParentView, toPathKey, toPathKeys, toPathValueStr } from '../utils/commonUtil';\nimport { toPathOptions } from '../utils/treeUtil';\nimport Column, { FIX_LABEL } from './Column';\nimport useActive from './useActive';\nimport useKeyboard from './useKeyboard';\nvar RefOptionList = /*#__PURE__*/React.forwardRef(function (props, ref) {\n  var _optionColumns$, _optionColumns$$optio, _ref3, _classNames;\n  var _useBaseProps = useBaseProps(),\n    prefixCls = _useBaseProps.prefixCls,\n    multiple = _useBaseProps.multiple,\n    searchValue = _useBaseProps.searchValue,\n    toggleOpen = _useBaseProps.toggleOpen,\n    notFoundContent = _useBaseProps.notFoundContent,\n    direction = _useBaseProps.direction;\n  var containerRef = React.useRef();\n  var rtl = direction === 'rtl';\n  var _React$useContext = React.useContext(CascaderContext),\n    options = _React$useContext.options,\n    values = _React$useContext.values,\n    halfValues = _React$useContext.halfValues,\n    fieldNames = _React$useContext.fieldNames,\n    changeOnSelect = _React$useContext.changeOnSelect,\n    onSelect = _React$useContext.onSelect,\n    searchOptions = _React$useContext.searchOptions,\n    dropdownPrefixCls = _React$useContext.dropdownPrefixCls,\n    loadData = _React$useContext.loadData,\n    expandTrigger = _React$useContext.expandTrigger;\n  var mergedPrefixCls = dropdownPrefixCls || prefixCls;\n  // ========================= loadData =========================\n  var _React$useState = React.useState([]),\n    _React$useState2 = _slicedToArray(_React$useState, 2),\n    loadingKeys = _React$useState2[0],\n    setLoadingKeys = _React$useState2[1];\n  var internalLoadData = function internalLoadData(valueCells) {\n    // Do not load when search\n    if (!loadData || searchValue) {\n      return;\n    }\n    var optionList = toPathOptions(valueCells, options, fieldNames);\n    var rawOptions = optionList.map(function (_ref) {\n      var option = _ref.option;\n      return option;\n    });\n    var lastOption = rawOptions[rawOptions.length - 1];\n    if (lastOption && !isLeaf(lastOption, fieldNames)) {\n      var pathKey = toPathKey(valueCells);\n      setLoadingKeys(function (keys) {\n        return [].concat(_toConsumableArray(keys), [pathKey]);\n      });\n      loadData(rawOptions);\n    }\n  };\n  // zombieJ: This is bad. We should make this same as `rc-tree` to use Promise instead.\n  React.useEffect(function () {\n    if (loadingKeys.length) {\n      loadingKeys.forEach(function (loadingKey) {\n        var valueStrCells = toPathValueStr(loadingKey);\n        var optionList = toPathOptions(valueStrCells, options, fieldNames, true).map(function (_ref2) {\n          var option = _ref2.option;\n          return option;\n        });\n        var lastOption = optionList[optionList.length - 1];\n        if (!lastOption || lastOption[fieldNames.children] || isLeaf(lastOption, fieldNames)) {\n          setLoadingKeys(function (keys) {\n            return keys.filter(function (key) {\n              return key !== loadingKey;\n            });\n          });\n        }\n      });\n    }\n  }, [options, loadingKeys, fieldNames]);\n  // ========================== Values ==========================\n  var checkedSet = React.useMemo(function () {\n    return new Set(toPathKeys(values));\n  }, [values]);\n  var halfCheckedSet = React.useMemo(function () {\n    return new Set(toPathKeys(halfValues));\n  }, [halfValues]);\n  // ====================== Accessibility =======================\n  var _useActive = useActive(),\n    _useActive2 = _slicedToArray(_useActive, 2),\n    activeValueCells = _useActive2[0],\n    setActiveValueCells = _useActive2[1];\n  // =========================== Path ===========================\n  var onPathOpen = function onPathOpen(nextValueCells) {\n    setActiveValueCells(nextValueCells);\n    // Trigger loadData\n    internalLoadData(nextValueCells);\n  };\n  var isSelectable = function isSelectable(option) {\n    var disabled = option.disabled;\n    var isMergedLeaf = isLeaf(option, fieldNames);\n    return !disabled && (isMergedLeaf || changeOnSelect || multiple);\n  };\n  var onPathSelect = function onPathSelect(valuePath, leaf) {\n    var fromKeyboard = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n    onSelect(valuePath);\n    if (!multiple && (leaf || changeOnSelect && (expandTrigger === 'hover' || fromKeyboard))) {\n      toggleOpen(false);\n    }\n  };\n  // ========================== Option ==========================\n  var mergedOptions = React.useMemo(function () {\n    if (searchValue) {\n      return searchOptions;\n    }\n    return options;\n  }, [searchValue, searchOptions, options]);\n  // ========================== Column ==========================\n  var optionColumns = React.useMemo(function () {\n    var optionList = [{\n      options: mergedOptions\n    }];\n    var currentList = mergedOptions;\n    var _loop = function _loop(i) {\n      var activeValueCell = activeValueCells[i];\n      var currentOption = currentList.find(function (option) {\n        return option[fieldNames.value] === activeValueCell;\n      });\n      var subOptions = currentOption === null || currentOption === void 0 ? void 0 : currentOption[fieldNames.children];\n      if (!(subOptions === null || subOptions === void 0 ? void 0 : subOptions.length)) {\n        return \"break\";\n      }\n      currentList = subOptions;\n      optionList.push({\n        options: subOptions\n      });\n    };\n    for (var i = 0; i < activeValueCells.length; i += 1) {\n      var _ret = _loop(i);\n      if (_ret === \"break\") break;\n    }\n    return optionList;\n  }, [mergedOptions, activeValueCells, fieldNames]);\n  // ========================= Keyboard =========================\n  var onKeyboardSelect = function onKeyboardSelect(selectValueCells, option) {\n    if (isSelectable(option)) {\n      onPathSelect(selectValueCells, isLeaf(option, fieldNames), true);\n    }\n  };\n  useKeyboard(ref, mergedOptions, fieldNames, activeValueCells, onPathOpen, onKeyboardSelect);\n  // >>>>> Active Scroll\n  React.useEffect(function () {\n    for (var i = 0; i < activeValueCells.length; i += 1) {\n      var _containerRef$current;\n      var cellPath = activeValueCells.slice(0, i + 1);\n      var cellKeyPath = toPathKey(cellPath);\n      var ele = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.querySelector(\"li[data-path-key=\\\"\".concat(cellKeyPath.replace(/\\\\{0,2}\"/g, '\\\\\"'), \"\\\"]\"));\n      if (ele) {\n        scrollIntoParentView(ele);\n      }\n    }\n  }, [activeValueCells]);\n  // ========================== Render ==========================\n  // >>>>> Empty\n  var isEmpty = !((_optionColumns$ = optionColumns[0]) === null || _optionColumns$ === void 0 ? void 0 : (_optionColumns$$optio = _optionColumns$.options) === null || _optionColumns$$optio === void 0 ? void 0 : _optionColumns$$optio.length);\n  var emptyList = [(_ref3 = {}, _defineProperty(_ref3, fieldNames.value, '__EMPTY__'), _defineProperty(_ref3, FIX_LABEL, notFoundContent), _defineProperty(_ref3, \"disabled\", true), _ref3)];\n  var columnProps = _objectSpread(_objectSpread({}, props), {}, {\n    multiple: !isEmpty && multiple,\n    onSelect: onPathSelect,\n    onActive: onPathOpen,\n    onToggleOpen: toggleOpen,\n    checkedSet: checkedSet,\n    halfCheckedSet: halfCheckedSet,\n    loadingKeys: loadingKeys,\n    isSelectable: isSelectable\n  });\n  // >>>>> Columns\n  var mergedOptionColumns = isEmpty ? [{\n    options: emptyList\n  }] : optionColumns;\n  var columnNodes = mergedOptionColumns.map(function (col, index) {\n    var prevValuePath = activeValueCells.slice(0, index);\n    var activeValue = activeValueCells[index];\n    return /*#__PURE__*/React.createElement(Column, _extends({\n      key: index\n    }, columnProps, {\n      prefixCls: mergedPrefixCls,\n      options: col.options,\n      prevValuePath: prevValuePath,\n      activeValue: activeValue\n    }));\n  });\n  // >>>>> Render\n  return /*#__PURE__*/React.createElement(\"div\", {\n    className: classNames(\"\".concat(mergedPrefixCls, \"-menus\"), (_classNames = {}, _defineProperty(_classNames, \"\".concat(mergedPrefixCls, \"-menu-empty\"), isEmpty), _defineProperty(_classNames, \"\".concat(mergedPrefixCls, \"-rtl\"), rtl), _classNames)),\n    ref: containerRef\n  }, columnNodes);\n});\nexport default RefOptionList;","map":{"version":3,"names":["_extends","_objectSpread","_defineProperty","_toConsumableArray","_slicedToArray","classNames","useBaseProps","React","CascaderContext","isLeaf","scrollIntoParentView","toPathKey","toPathKeys","toPathValueStr","toPathOptions","Column","FIX_LABEL","useActive","useKeyboard","RefOptionList","forwardRef","props","ref","_optionColumns$","_optionColumns$$optio","_ref3","_classNames","_useBaseProps","prefixCls","multiple","searchValue","toggleOpen","notFoundContent","direction","containerRef","useRef","rtl","_React$useContext","useContext","options","values","halfValues","fieldNames","changeOnSelect","onSelect","searchOptions","dropdownPrefixCls","loadData","expandTrigger","mergedPrefixCls","_React$useState","useState","_React$useState2","loadingKeys","setLoadingKeys","internalLoadData","valueCells","optionList","rawOptions","map","_ref","option","lastOption","length","pathKey","keys","concat","useEffect","forEach","loadingKey","valueStrCells","_ref2","children","filter","key","checkedSet","useMemo","Set","halfCheckedSet","_useActive","_useActive2","activeValueCells","setActiveValueCells","onPathOpen","nextValueCells","isSelectable","disabled","isMergedLeaf","onPathSelect","valuePath","leaf","fromKeyboard","arguments","undefined","mergedOptions","optionColumns","currentList","_loop","i","activeValueCell","currentOption","find","value","subOptions","push","_ret","onKeyboardSelect","selectValueCells","_containerRef$current","cellPath","slice","cellKeyPath","ele","current","querySelector","replace","isEmpty","emptyList","columnProps","onActive","onToggleOpen","mergedOptionColumns","columnNodes","col","index","prevValuePath","activeValue","createElement","className"],"sources":["/data/messenger.client/node_modules/rc-cascader/es/OptionList/index.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\n/* eslint-disable default-case */\nimport classNames from 'classnames';\nimport { useBaseProps } from 'rc-select';\nimport * as React from 'react';\nimport CascaderContext from '../context';\nimport { isLeaf, scrollIntoParentView, toPathKey, toPathKeys, toPathValueStr } from '../utils/commonUtil';\nimport { toPathOptions } from '../utils/treeUtil';\nimport Column, { FIX_LABEL } from './Column';\nimport useActive from './useActive';\nimport useKeyboard from './useKeyboard';\nvar RefOptionList = /*#__PURE__*/React.forwardRef(function (props, ref) {\n  var _optionColumns$, _optionColumns$$optio, _ref3, _classNames;\n  var _useBaseProps = useBaseProps(),\n    prefixCls = _useBaseProps.prefixCls,\n    multiple = _useBaseProps.multiple,\n    searchValue = _useBaseProps.searchValue,\n    toggleOpen = _useBaseProps.toggleOpen,\n    notFoundContent = _useBaseProps.notFoundContent,\n    direction = _useBaseProps.direction;\n  var containerRef = React.useRef();\n  var rtl = direction === 'rtl';\n  var _React$useContext = React.useContext(CascaderContext),\n    options = _React$useContext.options,\n    values = _React$useContext.values,\n    halfValues = _React$useContext.halfValues,\n    fieldNames = _React$useContext.fieldNames,\n    changeOnSelect = _React$useContext.changeOnSelect,\n    onSelect = _React$useContext.onSelect,\n    searchOptions = _React$useContext.searchOptions,\n    dropdownPrefixCls = _React$useContext.dropdownPrefixCls,\n    loadData = _React$useContext.loadData,\n    expandTrigger = _React$useContext.expandTrigger;\n  var mergedPrefixCls = dropdownPrefixCls || prefixCls;\n  // ========================= loadData =========================\n  var _React$useState = React.useState([]),\n    _React$useState2 = _slicedToArray(_React$useState, 2),\n    loadingKeys = _React$useState2[0],\n    setLoadingKeys = _React$useState2[1];\n  var internalLoadData = function internalLoadData(valueCells) {\n    // Do not load when search\n    if (!loadData || searchValue) {\n      return;\n    }\n    var optionList = toPathOptions(valueCells, options, fieldNames);\n    var rawOptions = optionList.map(function (_ref) {\n      var option = _ref.option;\n      return option;\n    });\n    var lastOption = rawOptions[rawOptions.length - 1];\n    if (lastOption && !isLeaf(lastOption, fieldNames)) {\n      var pathKey = toPathKey(valueCells);\n      setLoadingKeys(function (keys) {\n        return [].concat(_toConsumableArray(keys), [pathKey]);\n      });\n      loadData(rawOptions);\n    }\n  };\n  // zombieJ: This is bad. We should make this same as `rc-tree` to use Promise instead.\n  React.useEffect(function () {\n    if (loadingKeys.length) {\n      loadingKeys.forEach(function (loadingKey) {\n        var valueStrCells = toPathValueStr(loadingKey);\n        var optionList = toPathOptions(valueStrCells, options, fieldNames, true).map(function (_ref2) {\n          var option = _ref2.option;\n          return option;\n        });\n        var lastOption = optionList[optionList.length - 1];\n        if (!lastOption || lastOption[fieldNames.children] || isLeaf(lastOption, fieldNames)) {\n          setLoadingKeys(function (keys) {\n            return keys.filter(function (key) {\n              return key !== loadingKey;\n            });\n          });\n        }\n      });\n    }\n  }, [options, loadingKeys, fieldNames]);\n  // ========================== Values ==========================\n  var checkedSet = React.useMemo(function () {\n    return new Set(toPathKeys(values));\n  }, [values]);\n  var halfCheckedSet = React.useMemo(function () {\n    return new Set(toPathKeys(halfValues));\n  }, [halfValues]);\n  // ====================== Accessibility =======================\n  var _useActive = useActive(),\n    _useActive2 = _slicedToArray(_useActive, 2),\n    activeValueCells = _useActive2[0],\n    setActiveValueCells = _useActive2[1];\n  // =========================== Path ===========================\n  var onPathOpen = function onPathOpen(nextValueCells) {\n    setActiveValueCells(nextValueCells);\n    // Trigger loadData\n    internalLoadData(nextValueCells);\n  };\n  var isSelectable = function isSelectable(option) {\n    var disabled = option.disabled;\n    var isMergedLeaf = isLeaf(option, fieldNames);\n    return !disabled && (isMergedLeaf || changeOnSelect || multiple);\n  };\n  var onPathSelect = function onPathSelect(valuePath, leaf) {\n    var fromKeyboard = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n    onSelect(valuePath);\n    if (!multiple && (leaf || changeOnSelect && (expandTrigger === 'hover' || fromKeyboard))) {\n      toggleOpen(false);\n    }\n  };\n  // ========================== Option ==========================\n  var mergedOptions = React.useMemo(function () {\n    if (searchValue) {\n      return searchOptions;\n    }\n    return options;\n  }, [searchValue, searchOptions, options]);\n  // ========================== Column ==========================\n  var optionColumns = React.useMemo(function () {\n    var optionList = [{\n      options: mergedOptions\n    }];\n    var currentList = mergedOptions;\n    var _loop = function _loop(i) {\n      var activeValueCell = activeValueCells[i];\n      var currentOption = currentList.find(function (option) {\n        return option[fieldNames.value] === activeValueCell;\n      });\n      var subOptions = currentOption === null || currentOption === void 0 ? void 0 : currentOption[fieldNames.children];\n      if (!(subOptions === null || subOptions === void 0 ? void 0 : subOptions.length)) {\n        return \"break\";\n      }\n      currentList = subOptions;\n      optionList.push({\n        options: subOptions\n      });\n    };\n    for (var i = 0; i < activeValueCells.length; i += 1) {\n      var _ret = _loop(i);\n      if (_ret === \"break\") break;\n    }\n    return optionList;\n  }, [mergedOptions, activeValueCells, fieldNames]);\n  // ========================= Keyboard =========================\n  var onKeyboardSelect = function onKeyboardSelect(selectValueCells, option) {\n    if (isSelectable(option)) {\n      onPathSelect(selectValueCells, isLeaf(option, fieldNames), true);\n    }\n  };\n  useKeyboard(ref, mergedOptions, fieldNames, activeValueCells, onPathOpen, onKeyboardSelect);\n  // >>>>> Active Scroll\n  React.useEffect(function () {\n    for (var i = 0; i < activeValueCells.length; i += 1) {\n      var _containerRef$current;\n      var cellPath = activeValueCells.slice(0, i + 1);\n      var cellKeyPath = toPathKey(cellPath);\n      var ele = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.querySelector(\"li[data-path-key=\\\"\".concat(cellKeyPath.replace(/\\\\{0,2}\"/g, '\\\\\"'), \"\\\"]\"));\n      if (ele) {\n        scrollIntoParentView(ele);\n      }\n    }\n  }, [activeValueCells]);\n  // ========================== Render ==========================\n  // >>>>> Empty\n  var isEmpty = !((_optionColumns$ = optionColumns[0]) === null || _optionColumns$ === void 0 ? void 0 : (_optionColumns$$optio = _optionColumns$.options) === null || _optionColumns$$optio === void 0 ? void 0 : _optionColumns$$optio.length);\n  var emptyList = [(_ref3 = {}, _defineProperty(_ref3, fieldNames.value, '__EMPTY__'), _defineProperty(_ref3, FIX_LABEL, notFoundContent), _defineProperty(_ref3, \"disabled\", true), _ref3)];\n  var columnProps = _objectSpread(_objectSpread({}, props), {}, {\n    multiple: !isEmpty && multiple,\n    onSelect: onPathSelect,\n    onActive: onPathOpen,\n    onToggleOpen: toggleOpen,\n    checkedSet: checkedSet,\n    halfCheckedSet: halfCheckedSet,\n    loadingKeys: loadingKeys,\n    isSelectable: isSelectable\n  });\n  // >>>>> Columns\n  var mergedOptionColumns = isEmpty ? [{\n    options: emptyList\n  }] : optionColumns;\n  var columnNodes = mergedOptionColumns.map(function (col, index) {\n    var prevValuePath = activeValueCells.slice(0, index);\n    var activeValue = activeValueCells[index];\n    return /*#__PURE__*/React.createElement(Column, _extends({\n      key: index\n    }, columnProps, {\n      prefixCls: mergedPrefixCls,\n      options: col.options,\n      prevValuePath: prevValuePath,\n      activeValue: activeValue\n    }));\n  });\n  // >>>>> Render\n  return /*#__PURE__*/React.createElement(\"div\", {\n    className: classNames(\"\".concat(mergedPrefixCls, \"-menus\"), (_classNames = {}, _defineProperty(_classNames, \"\".concat(mergedPrefixCls, \"-menu-empty\"), isEmpty), _defineProperty(_classNames, \"\".concat(mergedPrefixCls, \"-rtl\"), rtl), _classNames)),\n    ref: containerRef\n  }, columnNodes);\n});\nexport default RefOptionList;"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,aAAa,MAAM,0CAA0C;AACpE,OAAOC,eAAe,MAAM,2CAA2C;AACvE,OAAOC,kBAAkB,MAAM,8CAA8C;AAC7E,OAAOC,cAAc,MAAM,0CAA0C;AACrE;AACA,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,YAAY,QAAQ,WAAW;AACxC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,eAAe,MAAM,YAAY;AACxC,SAASC,MAAM,EAAEC,oBAAoB,EAAEC,SAAS,EAAEC,UAAU,EAAEC,cAAc,QAAQ,qBAAqB;AACzG,SAASC,aAAa,QAAQ,mBAAmB;AACjD,OAAOC,MAAM,IAAIC,SAAS,QAAQ,UAAU;AAC5C,OAAOC,SAAS,MAAM,aAAa;AACnC,OAAOC,WAAW,MAAM,eAAe;AACvC,IAAIC,aAAa,GAAG,aAAaZ,KAAK,CAACa,UAAU,CAAC,UAAUC,KAAK,EAAEC,GAAG,EAAE;EACtE,IAAIC,eAAe,EAAEC,qBAAqB,EAAEC,KAAK,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